<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('address', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->integer('user_id')->unsigned()->comment('地址所有者');

            $table->string('name')->default('')->comment('收货人');

            $table->string('phone')->comment('手机号');

            $table->string('address')->comment('地址');

            $table->string('address_index')->comment('表单选中下标');

            $table->string('address_detail')->comment('详细地址');

            $table->string('label')->default('')->comment('标签');

            $table->integer('is_default')->default(2)->unsigned()->comment('是否是默认地址，1是2否');



        });

        DB::statement("ALTER TABLE `address` COMMENT='地址表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('address');
    }
}
